<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="template">
<head>
<title>Add Task</title>
</head>
<body>
	<!-- /* Content of this page will be decorated by the elements of layout.html (task/layout) */ -->
	<div layout:fragment="content">
		<div class="page-header">
			<h1>Add a new task</h1>
		</div>
		<form id="form" class="form" role="form" th:object="${task}"
			th:action="@{/tasks}" method="post">

			<div id="nameField"
				class="form-group" th:classappend="${#fields.hasErrors('name')} ? 'has-error'">
				<label class="control-label" for="name"> Task Name:</label> <input
					id="name" type="text" class="form-control"
					th:field="*{name}"></input>
				<div class="help-block">
					<p th:errors="*{name}" th:remove="tag"></p>
				</div>
			</div>

			<div id="descField"
				class="form-group" th:classappend="${#fields.hasErrors('description')} ? 'has-error'">

				<label class="control-label" for="description">Description:</label>
				<textarea id="description" class="form-control"
					th:field="*{description}" rows="8"></textarea>
				<div class="help-block">
					<p th:errors="*{description}" th:remove="tag"></p>
				</div>
			</div>

			<div class="form-group">
				<button id="submitTask" type="submit" class="btn btn-lg btn-primary">Add
					Task</button>
			</div>
		</form>
	</div>
</body>
</html>